﻿@model SAIM.Models.ImmovablesViewModel

@{
    ViewBag.Title = "Solicitud de uso de Infraestructura";
}

@section css {
    @Styles.Render("~/Content/datetimepicker")
}


<h2>@ViewBag.Title</h2>

<p class="text-success">@ViewBag.StatusMessage</p>
@using (Html.BeginForm("Immovables", "Applications", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{
    @Html.AntiForgeryToken()
    <hr />
    <div class="form-group">
        @Html.LabelFor(m => m.Immovable, new { @class = "col-md-2 col-sm-2 control-label" })
        <div class="col-md-10 col-sm-10">
            @Html.DropDownListFor(m => m.Immovable, Model.Immovables, new { @class = "form-control saim-sm-2" })
            @Html.ValidationMessageFor(m => m.Immovable, "", new { @class = "text-danger" })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.ReservationDate, new { @class = "col-sm-2 control-label" })
        <div class="col-md-10 col-sm-10">
            <div id="Date" class="input-group datepicker col-sm-10 saim-sm-2" data-provide="datepicker">
                @Html.TextBoxFor(m => m.ReservationDate, new { @class = "form-control", @id = "Date-Val", @readonly = "readonly" })
                <div class="btn btn-default input-group-addon">
                    <span class="glyphicon glyphicon-calendar"></span>
                </div>
            </div>
            @Html.ValidationMessageFor(m => m.ReservationDate, "", new { @class = "text-danger" })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.Observations, new { @class = "col-md-2 col-sm-2 control-label" })
        <div class="col-md-10 col-sm-10">
            @Html.TextAreaFor(m => m.Observations, new { @class = "form-control saim-sm-2", @rows = "7" })
            @Html.ValidationMessageFor(m => m.Observations, "", new { @class = "text-danger" })
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-offset-2 col-sm-offset-2 col-md-10 col-sm-10">
            <input type="submit" class="btn btn-default" value="Solicitar" />
        </div>
    </div>
}

@section Scripts {
    @Scripts.Render("~/bundles/datetimepicker")
    <script type="text/javascript">
        $(function () {
            $('#Date').datetimepicker({
                useCurrent: false,
                daysOfWeekDisabled: [0, 6],
                sideBySide: true,
                stepping: 30,
                locale: 'es',
                ignoreReadonly: true,
                minDate: moment()
            });
        });
    </script>
}